home *** CD-ROM | disk | FTP | other *** search
- property pElementList, pFieldName, pFieldSprite, pCurActive
-
- on new me, propList
- set pElementList to getaProp(propList, #list)
- set pFieldName to getaProp(propList, #textField)
- set pFieldSprite to getaProp(propList, #textSprite)
- set pCurActive to getaProp(propList, #cur)
- if not integerp(pCurActive) then
- set pCurActive to getPos(pElementList, pCurActive)
- end if
- populateList(me)
- set the textHeight of field pFieldName to the textHeight of field pFieldName
- if count(pElementList) > 0 then
- SetActive(me, pCurActive)
- else
- SetActive(me, 0)
- end if
- return me
- end
-
- on populateList me
- set text to EMPTY
- repeat with i = 1 to count(pElementList)
- put string(getAt(pElementList, i)) into line i of text
- end repeat
- put text into field pFieldName
- end
-
- on SetActive me, c
- if not integer(c) then
- set c to getPos(pElementList, c)
- end if
- if c >= 0 then
- set pCurActive to c
- if c = 1 then
- set c1 to 1
- else
- set c1 to the number of chars in line 1 to c - 1 of field pFieldName + 2
- end if
- set c2 to the number of chars in line 1 to c of field pFieldName + 1
- hilite char c1 to c2 of field pFieldName
- end if
- end
-
- on Drag me
- repeat while the stillDown
- fieldClick(me, the mouseLine)
- end repeat
- return pCurActive
- end
-
- on fieldClick me, c
- if c > count(pElementList) then
- set c to count(pElementList)
- end if
- SetActive(me, c)
- end
-